Quasi-cyclic low-density parity-check (QC-LDPC) codes are a special type of LDPC codes. QC-LDPC codes (as opposed to non-QC-LDPC codes) have parity check matrices that can be broken down into a building block called a circulant. Encoders that use QC-LDPC codes expect input data to have a length that is an integer multiple of the circulant size. It would be desirable if new techniques could be developed that permit other data lengths. In some embodiments, an encoder includes a multistage encoder where a parity check matrix or a generator matrix is broken down into sub-matrices and the various stages of the multistage encoder use respective sub-matrices. It would be further desirable if the new techniques which permit data lengths which are not integer multiples of the circulant size also work with multistage coding techniques.